﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfTraveSpecialtyList.aspx.cs" Inherits="msBsc.WebUi.wMall.Public.wfTraveSpecialtyList" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>购物列表</title>
    <link href="/jqPlugin/SelectSimu/css/base.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/sLayout.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/Public/sTravel.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/pagination.css" rel="stylesheet" />
    <style>
        #divPage a, #divPage span {
            color: #333;
        }

        .condition_city {
            float: left;
            margin: 43px 5px;
        }
    </style>
</head>
<body>
    <%=msBsc.WebUi.Code.QtHtmlGet.GetHeaderLoginInfo() %>
    <div class="viewContent">
        <input type="hidden" id="countryId" value="DF6723BE-A25C-4F77-BB49-A1662D3E6F2A" />
        <input type="hidden" id="cityId" value="AEF39D8E-D298-4AF1-AEC5-2B00D237F5F5" />
        <input type="hidden" id="destionId" value="" />
        <input type="hidden" id="pageIndex" value="1" />
        <div class="v_title">
            <div class="condition_title">
                <span class="vt_specialtysimg"></span>
                <span class="vt_name">购物资讯</span>
            </div>
            <div class="condition_city" id="countryId_select"></div>
            <div class="condition_city" id="cityId_select"></div>
            <div class="condition_city" id="destionId_select"></div>
        </div>
        <ul class="travel_lit" id="travel_list">
        </ul>
        <div class="jpage" id="divPage"></div>
        <xmp id="svc_list_temp" style="display: none;">
            {{#for(var i=0,len=d.rows.length;i < len;i++){ }}
             <li>
                <a class="travelC" href="/wp_TravelSpecialtyInfo.htm?specialtyId={{d.rows[i].SPECIALTY_ID}}" target="_blank">
                    <img src="http://www.dijieke.com/UpLoad/specialty/{{d.rows[i].SPECIALTY_DEFAULT_PIC}} 240x198img.jpg" title="{{d.rows[i].SPECIALTY_NAME}}" />

                </a>
                <div class="classicInfo">
                    <div class="tl_fName"><a>{{d.rows[i].SPECIALTY_NAME}}</a></div>
                </div>
            </li>
            {{#} }}
        </xmp>
    </div>
    <%=msBsc.WebUi.Code.QtHtmlGet.GetFloorHtml() %>
    <!--start JS引用-->
    <script src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
    <script src="/jqPlugin/js/jBase.js"></script>
    <script src="/jqPlugin/js/jBPage.js"></script>
    <script src="/jqPlugin/js/laytpl.js"></script>
    <script src="/jqPlugin/SelectSimu/js/SelectSimu.js"></script>
    <script src="/themes/wStyle1/js/comm/jsLayout.js"></script>
    <script src="/themes/wStyle1/js/comm/jsPagination.js"></script>
    <script src="/themes/wStyle1/js/comm/VerifyJs.js"></script>
    <!--end JS引用-->
    <script type="text/javascript">

        setArea("countryId_select", 82, 1, 1, ["DF6723BE-A25C-4F77-BB49-A1662D3E6F2A"], ["中国"]);
        setArea("cityId_select", 82, 2, 1, ["AEF39D8E-D298-4AF1-AEC5-2B00D237F5F5"], ["北京"]);
        setArea("destionId_select", 82, 3, 1, [""], ["全部"]);
        setArea("travel_type", 82, 4, 3, ["景点", "美食", "购物"], ["景点", "美食", "购物"]);
        (function () {
            $("#countryId").val(GetQueryStr("countryId"));
            $("#cityId").val(GetQueryStr("cityId"));
            $("#destionId").val(GetQueryStr("destionId"));
            $("#pageIndex").val(GetQueryStr("pIndex"));
            $("#travel_type span").text("购物");
            $("#travel_type input").val("购物");
            btnDo("init");
            checkCity();
        })()

        function checkCity() {
            $('#countryId_select .selectList li').live('click', function () {
                var countryId = this.getAttribute('data-value');
                var cityId = "";
                var destionId = "";
                window.location.href = "/wp_TraveSpecialtyList.htm?countryId=" + countryId + "&cityId=" + cityId + "&destionId=" + destionId + "&pIndex=" + 1;
            });
            $('#cityId_select .selectList li').live('click', function () {
                var countryId = $('#countryId_select input').val();
                var cityId = this.getAttribute('data-value');
                var destionId = "";
                window.location.href = "/wp_TraveSpecialtyList.htm?countryId=" + countryId + "&cityId=" + cityId + "&destionId=" + destionId + "&pIndex=" + 1;
            });
            $('#destionId_select .selectList li').live('click', function () {
                var countryId = $('#countryId_select input').val();
                var cityId = $('#cityId_select input').val();
                var destionId = this.getAttribute('data-value');
                window.location.href = "/wp_TraveSpecialtyList.htm?countryId=" + countryId + "&cityId=" + cityId + "&destionId=" + destionId + "&pIndex=" + 1;
            });
            $('#travel_type .selectList li').live('click', function () {
                var countryId = $('#countryId_select input').val();
                var cityId = $('#cityId_select input').val();
                var destionId = $('#destionId_select input').val();
                var type = this.getAttribute('data-value');
                if (type == "美食") {
                    window.location.href = "/wp_TraveFoodList.htm?countryId=" + countryId + "&cityId=" + cityId + "&destionId=" + destionId + "&pIndex=" + 1;
                } else if (type == "景点") {
                    window.location.href = "/wp_TravelScenicList.htm?countryId=" + countryId + "&cityId=" + cityId + "&destionId=" + destionId + "&pIndex=" + 1;
                }

            });
        }

        function btnDo(sEbtn) {
            GtGrid1Action = sEbtn;
            var opart = new jsonRow();
            if (sEbtn == "init") {
                opart = GetGtParam();
                opart = addNoAreStatistics(opart, "资讯购物列表", "w0013");
            }
            ajaxComm(opart);
        };
        //执行AJAX调用时获取参数
        function GetGtParam() {
            var pIndex = $("#pageIndex").val();
            if (IsNull(pIndex) || isNaN(pIndex)) {
                pIndex = 1;
            }
            var _jsParam = new jsonRow();
            _jsParam.AddCell("pageRows", "12");
            _jsParam.AddCell("pageNum", pIndex);
            _jsParam.AddCell("parentsId", "00000000-0000-0000-0000-000000000000");
            _jsParam.AddCell("isAll", "true");
            _jsParam.AddCell("destionId", $("#destionId").val());
            _jsParam.AddCell("cityId", $("#cityId").val());
            _jsParam.AddCell("countryId", $("#countryId").val());
            _jsParam.AddCell("ACTION", GtGrid1Action);
            return _jsParam;
        };


        function setArea(input, width, zIndex, listNum, listValue, listOption) {
            $("#" + input).SelectSimu({
                width: width,
                zIndex: zIndex,
                listNum: listNum,
                listValue: listValue,
                listOption: listOption,
                imgSrc: '/jqPlugin/SelectSimu/img/icon_down.png'
            })
        }

        function updateSelet(inputId, data, selectId) {
            var selectValue = $("#" + inputId + " .selectList ul");
            selectValue.html("");
            var isSelect = false;
            for (var i = 0; i < data.rows.length; i++) {
                if (selectId == data.rows[i].COUNTRY_CITY_ID) {
                    $("#" + inputId + " input").val(data.rows[i].COUNTRY_CITY_ID);
                    $("#" + inputId + " span").text(data.rows[i].COUNTRY_CITY_NME);
                    isSelect = true;
                }
                selectValue.append('<li data-value="' + data.rows[i].COUNTRY_CITY_ID + '">' + data.rows[i].COUNTRY_CITY_NME + '</li>');
            }
            if (isSelect == false && data.rows.length > 0) {
                $("#" + inputId + " input").val(data.rows[0].COUNTRY_CITY_ID);
                $("#" + inputId + " span").text(data.rows[0].COUNTRY_CITY_NME);
            }
        }

        function laySvcList(svcListData, rows) {
            var _html = $('#svc_list_temp').html();
            //$("#scenicList").html("");
            laytpl(_html).render(svcListData, function (render) {
                $("#travel_list").html(render);
            });
            var pIndex = $("#pageIndex").val();
            if (IsNull(pIndex) || isNaN(pIndex)) {
                pIndex = 1;
            }
            jsPage('divPage', rows, 12, pIndex, 'goPage');
        };
        //laySvcList();
        function goPage(pIndex) {
            var countryId = $("#countryId").val();
            var cityId = $("#cityId").val();
            var destionId = $("#destionId").val();
            window.location.href = "/wp_TraveSpecialtyList.htm?countryId=" + countryId + "&cityId=" + cityId + "&destionId=" + destionId + "&pIndex=" + pIndex;
        }
    </script>
</body>
</html>
